package com.profound.blog.dao;

import java.util.ArrayList;
import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Repository;

import com.profound.blog.bean.SysArticleType;

@Repository
public class ArticleTypeDAO {
	@Autowired
	private SqlSessionTemplate template;
	
	private static final String SYS_ARTICLE_TYPE_CLASS_NAME = SysArticleType.class.getName();
	
	public List<SysArticleType> selectSysArticleType() {
		List<SysArticleType> list = new ArrayList<SysArticleType>();
		list = this.template.selectList(SYS_ARTICLE_TYPE_CLASS_NAME+".selectSysArticleType");
		return list;
	}
	
//	public static void main(String[] args) {
//		ClassPathXmlApplicationContext c = new ClassPathXmlApplicationContext("app.xml");
//		ArticleTypeDAO dao = c.getBean(ArticleTypeDAO.class);
//		System.out.println(dao.selectSysArticleType());
//		c.close();
//	}
}
